package com.fallsvc.user.convert;

import com.fallsvc.common.utils.SecurityUtil;
import com.fallsvc.user.api.pojo.request.UserInfoRegisterRequest;
import com.fallsvc.user.api.pojo.request.UserInfoRequest;
import com.fallsvc.user.dataobject.UserInfo;

/**
 * @auther falls_vc
 * description:
 * @date 2025/9/19  14:35
 */
public class BeanConvert {

    public static UserInfo convertUserInfoByEncrypt(UserInfoRegisterRequest userInfoRegisterRequest) {
        UserInfo userInfo = new UserInfo();
        userInfo.setUserName(userInfoRegisterRequest.getUserName());
        userInfo.setPassword(SecurityUtil.encrypt(userInfoRegisterRequest.getPassword()));
        userInfo.setGithubUrl(userInfoRegisterRequest.getGithubUrl());
        userInfo.setEmail(userInfoRegisterRequest.getEmail());

        return userInfo;
    }
}
